{include 'header.tpl'}
<div class="views">
    <div class="order_tab">
        <ul>
            <li {if $status == 2} class="order_ative" {/if}><a href="/seller/order/manager"><i class="iconfont">&#xe61c;</i><span>待接单</span></a></li>
            <li {if $status == 3} class="order_ative" {/if} ><a href="/seller/order/manager?status=3"><i class="iconfont">&#xe770;</i><span>待配送</span></a></li>
        </ul>
    </div>
    {if $order_list}
    <div class="order_cont cf">
        <ul>
            {foreach from=$order_list item=order name=foo}
            <li>
                <div class="order_adv">
                    <div class="order_tel cf"><a href="tel:{$order.phone}" ><span>{$order.contact}</span><span>{$order.phone}</span><i class="iconfont order_right order_blue">&#xe61b;</i></a></div>
                    <div class="order_adver cf">
                        <a href="/seller/location/baidu?x={$order.lng}&y={$order.lat}">
                            <span style="float:left;">收货地址：</span>
                            <span style="float:left; width:5.3rem;">{$order.province} {$order.city} {$order.county} {$order.address}</span>
                            <span style=" float:right;">{$order.dis}km<i class="iconfont order_right">&#xe607;</i></span>
                        </a>
                    </div>

                    <div class="order_time"><span>预计送达时间：</span><span class="order_blue">{$order.send_time}</span></div>
                </div>
                <div class="order_shop">
                    <div class="money_title shop_ywy">商品信息<span class="order_right order_blue open">展开</span></div>
                    <div class="money_cont">
                        {foreach from=$order.products item=p name=foo}
                        <p><span class="money_jl">{$p.title}</span>
                            {if $p.spec_list}
                                {foreach from=$p.spec_list|json_decode:true item=i name=foo}
                                 <span>{assign var=obj value=$i|json_decode:true}
                                 {$obj.value}
                                 </span>
                                {/foreach}
                            {/if}
                            <span class="order_blue">¥{$p.price_new}</span>
                            <span class="order_right">×{$p.paynum}</span></p>
                        {/foreach}
                    </div>
                </div>
                <div class="order_money">
                    <div class="money_title">预计收入<span class="order_right order_blue">¥{$order.pay_price}</span></div>
                    <div class="money_title">配送费：<span class="order_right" style="color: #ff8807;">¥{$order.send_price}</span></div>
                    <div class="money_title">优惠金额:<span class="order_right" style="color: #ff8807;">¥{$order.youhui_price}</span></div>
                    <div class="money_cont">
                        <p>订单编号：{$order.o_id}</p>
                        <p>下单时间：{$order.create_time}</p>
                        <p>备注：{$order.remark}</p>
                    </div>
                </div>
                {if $status==2}
                <div class="order_button"><button class="distri torec" oid="{$order.auto_id}">接单</button></div>
                {/if}
                {if $status == 3}
                <div class="order_button"><button class="distri tosend"  oid="{$order.auto_id}" >配送</button></div>
                {/if}
            </li>
            {/foreach}
        </ul>
    </div>
    {else}
        <div class="blank_order">
            <img src="/seller/images/kblan.png">
            <p>暂无数据...</p>
        </div>
    {/if}

{literal}
        <script>
            $(function(){
                var isopen= false;
                 $('div.order_shop .money_cont').hide();
                $('.open').click(function(){
                   $(this).parent().next('.money_cont').toggle();
                    isopen= !isopen;
                    if(isopen){
                        $(this).text("关闭");
                    }else{
                        $(this).text("展开");
                    }
                });
                $('.torec').click(function(){
                    var oid=$(this).attr('oid');
                    window.location.href="/seller/order/receive?oid="+oid;
                });
                $('.tosend').click(function(){
                    var oid=$(this).attr('oid');
                    window.location.href="/seller/order/bsend?oid="+oid;
                });
            });
        </script>
{/literal}

{include 'footer.tpl'}